﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace Managistics.Model.Mappings
{
    public class OutputSheetDetailMap : ClassMap<OutputSheetDetail>
    {

        public OutputSheetDetailMap()
        {
            Schema(Constants._tblSchema);
            Table(Constants._tblDetailOutputCustomer);
            LazyLoad();

            CompositeId().KeyProperty(x => x.OutputSheetId, "OUTPUT_SHEET_ID")
                         .KeyProperty(x => x.ItemId, "ITEM_ID");

            References(x => x.OutputSheet).Column("OUTPUT_SHEET_ID");
            References(x => x.Good).Column("ITEM_ID");

            Map(x => x.Quantity).Column("QUANTITY_OUTPUT").Not.Nullable().Precision(53);
            Map(x => x.Remark).Column("REMARK").Length(4000);
            Map(x => x.Number).Column("Number").Precision(10);
            Map(x => x.Id).Column("Id").Not.Nullable().Precision(18);
        }
    }
}
